<?php
	//while (list($name, $value) = each($_POST)) {
    	//echo "$name = $value<br>\n";
	//}
  
	//echo session_encode();
	
	/*
 	eg ProductID 12 and quantity 1
	$strNewItem = "sesItem".$intItem  is "sesItem12"
	$$strNewItem = $intItem is "1"
	session_register($strNewItem); is actually session_register(sesItem12);
	*/
	
	
	/*
	 * Orignal Basket processing section
	$strNewItem = "sesItem".$intItem;
	
		// If Item is already in basket add 1 to existing quantity			
		if ($$strNewItem > 0){
			$$strNewItem ++;
		}else{
			$$strNewItem = 1;
		}
			
	session_register($strNewItem);
	*/
	
	//If no colour set to 0
	if(!$_POST['cboColour']){
		$_POST['cboColour'] = 0;
	}

	if(!$_POST['cboSize']){
		$_POST['cboSize'] = 0;
	}
	
	if(isset($_REQUEST['intItem']))
		$iProduct = $_REQUEST['intItem'];
	else 
		$iProduct = 0;
	
	//Item with Colour and size
	$strItemColourSize = "sesItem".$iProduct."_".$_POST['cboColour']."_".$_POST['cboSize'];
	// If Item is already in basket add 1 to existing quantity
			
		if ($$strItemColourSize > 0){
			$$strItemColourSize ++;
		}else{
			$$strItemColourSize = 1;
		}
	$_SESSION[$strItemColourSize] = $$strItemColourSize;		
	//session_register($strItemColourSize);

	
?>